subroutine checknc(status)
   use netcdf
   implicit none
   integer, intent (in) :: status
    
   if(status /= nf90_noerr) then 
      print *, trim(nf90_strerror(status))
      stop "Stopped"
   end if
end subroutine checknc
